﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DatailsView控件.aspx.cs" Inherits="数据访问控件_DatailsView控件"  ValidateRequest="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataSourceID="LinqDataSource1" Height="50px" Width="125px" 
            AllowPaging="True" DataKeyNames="Id" DefaultMode="Edit" 
            onpageindexchanging="DetailsView1_PageIndexChanging" 
            style="margin-right: 369px">
            <Fields>
                <asp:boundfield DataField="Id" HeaderText="Id" ReadOnly="True" 
                    SortExpression="Id" InsertVisible="False"></asp:boundfield>
                <asp:boundfield DataField="ClassId" HeaderText="ClassId" 
                    SortExpression="ClassId"></asp:boundfield>
                <asp:boundfield DataField="RepCount" HeaderText="RepCount" 
                    SortExpression="RepCount"></asp:boundfield>
                <asp:boundfield DataField="Title" HeaderText="Title" 
                    SortExpression="Title"></asp:boundfield>
                <asp:boundfield DataField="ReleaseDate" HeaderText="ReleaseDate" 
                    SortExpression="ReleaseDate"></asp:boundfield>
                <asp:boundfield DataField="Content" HeaderText="Content" 
                    SortExpression="Content"></asp:boundfield>
                <asp:boundfield DataField="AuthorId" HeaderText="AuthorId" 
                    SortExpression="AuthorId"></asp:boundfield>
                <asp:boundfield DataField="Score" HeaderText="Score" SortExpression="Score">
                </asp:boundfield>
                <asp:checkboxfield DataField="Dis" HeaderText="Dis" SortExpression="Dis">
                </asp:checkboxfield>
                <asp:checkboxfield DataField="SendMail" HeaderText="SendMail" 
                    SortExpression="SendMail"></asp:checkboxfield>
                <asp:boundfield DataField="State" HeaderText="State" SortExpression="State">
                </asp:boundfield>
                <asp:boundfield DataField="Recruit" HeaderText="Recruit" 
                    SortExpression="Recruit"></asp:boundfield>
                <asp:boundfield DataField="UpdateDate" HeaderText="UpdateDate" 
                    SortExpression="UpdateDate"></asp:boundfield>
                <asp:checkboxfield DataField="Elite" HeaderText="Elite" SortExpression="Elite">
                </asp:checkboxfield>
                <asp:boundfield DataField="LastRepDate" HeaderText="LastRepDate" 
                    SortExpression="LastRepDate"></asp:boundfield>
                <asp:boundfield DataField="Hit" HeaderText="Hit" SortExpression="Hit">
                </asp:boundfield>
                <asp:boundfield DataField="LastRepAuthorId" HeaderText="LastRepAuthorId" 
                    SortExpression="LastRepAuthorId"></asp:boundfield>
                <asp:boundfield DataField="LastRepAuthor" HeaderText="LastRepAuthor" 
                    SortExpression="LastRepAuthor"></asp:boundfield>
                <asp:boundfield DataField="Author" HeaderText="Author" SortExpression="Author">
                </asp:boundfield>
                <asp:boundfield DataField="LastBrowse" HeaderText="LastBrowse" 
                    SortExpression="LastBrowse"></asp:boundfield>
                <asp:boundfield DataField="SourceUrl" HeaderText="SourceUrl" 
                    SortExpression="SourceUrl"></asp:boundfield>
                <asp:commandfield ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True"></asp:commandfield>
            </Fields>
        </asp:DetailsView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/db1.mdb" DeleteCommand="DELETE FROM [lx] WHERE [id] = ?" 
            InsertCommand="INSERT INTO lx(lx) VALUES (?)" 
            SelectCommand="SELECT [id], [lx] FROM [lx]" 
            UpdateCommand="UPDATE [lx] SET [lx] = ? WHERE [id] = ?">
            <DeleteParameters>
                <asp:parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:parameter Name="lx" Type="String" />
                <asp:parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:parameter Name="id" Type="Int32" />
                <asp:parameter Name="lx" Type="String" />
            </InsertParameters>
        </asp:AccessDataSource>
        <br />
        个第离开         <asp:DetailsView ID="DetailsView2" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="id" DataSourceID="AccessDataSource1" 
            Height="50px" Width="125px">
            <Fields>
                <asp:boundfield DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id"></asp:boundfield>
                <asp:templatefield HeaderText="lx" SortExpression="lx">
                    <edititemtemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Height="160px" 
                            Text='<%# Bind("lx") %>' Width="430px"></asp:TextBox>
                    </edititemtemplate>
                    <insertitemtemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Height="113px" 
                            Text='<%# Bind("lx") %>' Width="432px"></asp:TextBox>
                    </insertitemtemplate>
                    <itemtemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("lx") %>'></asp:Label>
                    </itemtemplate>
                </asp:templatefield>
                <asp:commandfield ShowEditButton="True" ShowInsertButton="True">
                </asp:commandfield>
            </Fields>
        </asp:DetailsView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="Linq_SQLServeDataContext" EnableDelete="True" 
            EnableInsert="True" EnableUpdate="True" TableName="M_Asks" 
            >
        </asp:LinqDataSource>
        <br />
        <br />
        LInq To Updta GridView but not update<asp:GridView ID="GridView1" runat="server" 
            AllowPaging="True" AllowSorting="True" DataKeyNames="bookid"  AutoGenerateColumns="False" 
            DataSourceID="LinqDataSource2">
            <Columns>
                <asp:commandfield ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True"></asp:commandfield>
                <asp:boundfield DataField="bookid" HeaderText="bookid" SortExpression="bookid">
                </asp:boundfield>
                <asp:boundfield DataField="mch" HeaderText="mch" SortExpression="mch">
                </asp:boundfield>
                <asp:boundfield DataField="pp" HeaderText="pp" SortExpression="pp">
                </asp:boundfield>
                <asp:boundfield DataField="qch" HeaderText="qch" SortExpression="qch">
                </asp:boundfield>
                <asp:boundfield DataField="jj" HeaderText="jj" SortExpression="jj">
                </asp:boundfield>
                <asp:boundfield DataField="rq" HeaderText="rq" SortExpression="rq">
                </asp:boundfield>
                <asp:boundfield DataField="jg" HeaderText="jg" SortExpression="jg">
                </asp:boundfield>
                <asp:boundfield DataField="zl" HeaderText="zl" SortExpression="zl">
                </asp:boundfield>
                <asp:boundfield DataField="xx" HeaderText="xx" SortExpression="xx">
                </asp:boundfield>
                <asp:boundfield DataField="isbn1" HeaderText="isbn1" SortExpression="isbn1">
                </asp:boundfield>
                <asp:boundfield DataField="tp" HeaderText="tp" SortExpression="tp">
                </asp:boundfield>
                <asp:boundfield DataField="nr" HeaderText="nr" SortExpression="nr">
                </asp:boundfield>
                <asp:boundfield DataField="ml" HeaderText="ml" SortExpression="ml">
                </asp:boundfield>
                <asp:boundfield DataField="bookname" HeaderText="bookname" 
                    SortExpression="bookname"></asp:boundfield>
                <asp:boundfield DataField="pingpai" HeaderText="pingpai" 
                    SortExpression="pingpai"></asp:boundfield>
                <asp:boundfield DataField="bookchuban" HeaderText="bookchuban" 
                    SortExpression="bookchuban"></asp:boundfield>
                <asp:boundfield DataField="bookdate" HeaderText="bookdate" 
                    SortExpression="bookdate"></asp:boundfield>
                <asp:boundfield DataField="kaiben" HeaderText="kaiben" SortExpression="kaiben">
                </asp:boundfield>
                <asp:boundfield DataField="yeshu" HeaderText="yeshu" SortExpression="yeshu">
                </asp:boundfield>
                <asp:boundfield DataField="banci" HeaderText="banci" SortExpression="banci">
                </asp:boundfield>
                <asp:boundfield DataField="zhuang" HeaderText="zhuang" SortExpression="zhuang">
                </asp:boundfield>
                <asp:boundfield DataField="isbn" HeaderText="isbn" SortExpression="isbn">
                </asp:boundfield>
                <asp:boundfield DataField="bookcontent" HeaderText="bookcontent" 
                    SortExpression="bookcontent"></asp:boundfield>
                <asp:boundfield DataField="bookmulu" HeaderText="bookmulu" 
                    SortExpression="bookmulu"></asp:boundfield>
                <asp:boundfield DataField="pingji" HeaderText="pingji" SortExpression="pingji">
                </asp:boundfield>
                <asp:boundfield DataField="shichangjia" HeaderText="shichangjia" 
                    SortExpression="shichangjia"></asp:boundfield>
                <asp:boundfield DataField="huiyuanjia" HeaderText="huiyuanjia" 
                    SortExpression="huiyuanjia"></asp:boundfield>
                <asp:boundfield DataField="vipjia" HeaderText="vipjia" SortExpression="vipjia">
                </asp:boundfield>
                <asp:boundfield DataField="bestbook" HeaderText="bestbook" 
                    SortExpression="bestbook"></asp:boundfield>
                <asp:boundfield DataField="tejiabook" HeaderText="tejiabook" 
                    SortExpression="tejiabook"></asp:boundfield>
                <asp:boundfield DataField="newsbook" HeaderText="newsbook" 
                    SortExpression="newsbook"></asp:boundfield>
                <asp:boundfield DataField="kucun" HeaderText="kucun" SortExpression="kucun">
                </asp:boundfield>
                <asp:boundfield DataField="chengjiaocount" HeaderText="chengjiaocount" 
                    SortExpression="chengjiaocount"></asp:boundfield>
                <asp:boundfield DataField="liulancount" HeaderText="liulancount" 
                    SortExpression="liulancount"></asp:boundfield>
                <asp:boundfield DataField="dazhe" HeaderText="dazhe" SortExpression="dazhe">
                </asp:boundfield>
                <asp:boundfield DataField="nclassid" HeaderText="nclassid" 
                    SortExpression="nclassid"></asp:boundfield>
                <asp:boundfield DataField="anclassid" HeaderText="anclassid" 
                    SortExpression="anclassid"></asp:boundfield>
                <asp:boundfield DataField="bookpic" HeaderText="bookpic" 
                    SortExpression="bookpic"></asp:boundfield>
                <asp:boundfield DataField="bookzz" HeaderText="bookzz" SortExpression="bookzz">
                </asp:boundfield>
                <asp:boundfield DataField="adddate" HeaderText="adddate" 
                    SortExpression="adddate"></asp:boundfield>
                <asp:boundfield DataField="pingjizong" HeaderText="pingjizong" 
                    SortExpression="pingjizong"></asp:boundfield>
                <asp:boundfield DataField="shjianame" HeaderText="shjianame" 
                    SortExpression="shjianame"></asp:boundfield>
                <asp:boundfield DataField="shjiaid" HeaderText="shjiaid" 
                    SortExpression="shjiaid"></asp:boundfield>
            </Columns>
        </asp:GridView>
        <br />
        <br />
        <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
            ContextTypeName="Linq查询DataContext" EnableDelete="True" EnableInsert="True" 
            EnableUpdate="True" TableName="books" Where="bookid == @bookid">
            <whereparameters>
                <asp:controlparameter ControlID="GridView1" Name="bookid" 
                    PropertyName="SelectedValue" Type="Decimal" />
            </whereparameters>
        </asp:LinqDataSource>
    </div>
    </form>
</body>
</html>
